import http from '@/utils/http'

const apiKey = '195a9b99ea7a0d259151b5c412bb631b'
let sign
if (process.env.NODE_ENV === 'production') {
  sign = localStorage.getItem('wx_sign')
} else {
  sign = '9fdb10f2cf96b45365d565d4f505dee5'
}

let uploadFileKey = 'Gn1xVdBiTClSSHKZifg0pTQSU5XGagWO'
let apiList = {
  getOssSign:
    'http://hfc.suoluomei.com/diagnose/public/index.php?s=/admin/photo/getOssAccessKeySecret'
}

let nowTime = new Date()
let nowYear = nowTime.getFullYear()
let nowMonth = nowTime.getMonth() + 1
let nowDay = nowTime.getDate()
let nowHour = nowTime.getHours()
let nowMinute = nowTime.getMinutes()
// fixed 修复日期的bug 格式必须为 '2019-xx-xx' ,'2019-1-3' 报错
const nowDate = `${nowYear}-${nowMonth < 10 ? '0' + nowMonth : nowMonth}-${
  nowDay < 10 ? '0' + nowDay : nowDay
}`

const ossThumb = '?x-oss-process=image/quality,Q_70'
const ossLarge = '?x-oss-process=image/quality,Q_100'

/**
 * @msg: 封装默认请求参数
 * @param {Object}
 * @return:
 */
const post = (url, data = {}) =>
  http.post(
    url,
    Object.assign(
      {
        api_key: apiKey,
        sign
      },
      data
    )
  ).then(response => response.data)

// 首页菜单
// const getNavigationList = data => post('getNavigationList', data)




export {

}
